/*
 Navicat Premium Data Transfer

 Source Server         : birthcaker
 Source Server Type    : MySQL
 Source Server Version : 50721
 Source Host           : 123.206.254.171:3306
 Source Schema         : birthcaker

 Target Server Type    : MySQL
 Target Server Version : 50721
 File Encoding         : 65001

 Date: 21/03/2018 22:20:04
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
  `id` varchar(255) NOT NULL,
  `user` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `province` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `district` varchar(255) NOT NULL,
  `detail` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `def` bit(1) DEFAULT b'0',
  `del` bit(1) DEFAULT b'0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
  `id` varchar(255) NOT NULL,
  `authing_id` varchar(255) NOT NULL,
  `token` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`authing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for bcorder
-- ----------------------------
DROP TABLE IF EXISTS `bcorder`;
CREATE TABLE `bcorder` (
  `id` varchar(255) NOT NULL,
  `user` varchar(255) DEFAULT NULL,
  `sellr` varchar(255) DEFAULT NULL,
  `store` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `freight` decimal(10,2) DEFAULT NULL,
  `trans_type` int(11) DEFAULT NULL,
  `count` int(11) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `recipient` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `detail` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for bcorder_item
-- ----------------------------
DROP TABLE IF EXISTS `bcorder_item`;
CREATE TABLE `bcorder_item` (
  `id` varchar(255) NOT NULL,
  `bcorder` varchar(255) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `count` int(11) DEFAULT NULL,
  `goods` varchar(255) DEFAULT NULL,
  `goods_name` varchar(255) DEFAULT NULL,
  `goods_price` decimal(10,2) DEFAULT NULL,
  `goods_size` decimal(10,2) DEFAULT NULL,
  `goods_unit` varchar(50) DEFAULT NULL,
  `goods_type` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for caketype
-- ----------------------------
DROP TABLE IF EXISTS `caketype`;
CREATE TABLE `caketype` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for cart
-- ----------------------------
DROP TABLE IF EXISTS `cart`;
CREATE TABLE `cart` (
  `id` varchar(255) NOT NULL,
  `user` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user` (`user`),
  UNIQUE KEY `user_2` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for cart_item
-- ----------------------------
DROP TABLE IF EXISTS `cart_item`;
CREATE TABLE `cart_item` (
  `id` varchar(255) NOT NULL,
  `cart` varchar(255) DEFAULT NULL,
  `goods` varchar(255) DEFAULT NULL,
  `count` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `store` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for deck
-- ----------------------------
DROP TABLE IF EXISTS `deck`;
CREATE TABLE `deck` (
  `id` varchar(255) NOT NULL,
  `introduction` varchar(255) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for deck_store_rel
-- ----------------------------
DROP TABLE IF EXISTS `deck_store_rel`;
CREATE TABLE `deck_store_rel` (
  `id` varchar(255) NOT NULL,
  `store` varchar(255) DEFAULT NULL,
  `deck` varchar(255) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `del` bit(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for diy_cart
-- ----------------------------
DROP TABLE IF EXISTS `diy_cart`;
CREATE TABLE `diy_cart` (
  `id` varchar(255) NOT NULL,
  `user` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for diy_cart_item
-- ----------------------------
DROP TABLE IF EXISTS `diy_cart_item`;
CREATE TABLE `diy_cart_item` (
  `id` varchar(255) NOT NULL,
  `cart` varchar(255) DEFAULT NULL,
  `count` int(11) DEFAULT NULL,
  `diy_work` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for diy_work
-- ----------------------------
DROP TABLE IF EXISTS `diy_work`;
CREATE TABLE `diy_work` (
  `id` varchar(255) NOT NULL,
  `user` varchar(255) NOT NULL,
  `store` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `photo` varchar(255) NOT NULL,
  `descriptions` varchar(255) DEFAULT NULL,
  `comment` varchar(255) DEFAULT NULL COMMENT '澶囨敞淇℃伅',
  `price` decimal(10,0) NOT NULL,
  `structure` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `embryo` varchar(255) DEFAULT NULL,
  `surface` varchar(255) DEFAULT NULL,
  `parts` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for embryo
-- ----------------------------
DROP TABLE IF EXISTS `embryo`;
CREATE TABLE `embryo` (
  `id` varchar(255) NOT NULL DEFAULT '',
  `cm_size` decimal(10,2) DEFAULT NULL,
  `inch_size` decimal(10,2) DEFAULT NULL,
  `pound` decimal(10,2) DEFAULT NULL,
  `sug_eat_person` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `shape` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of embryo
-- ----------------------------
BEGIN;
INSERT INTO `embryo` VALUES ('508e87e456fc4c459458301dc86f984f', 10.00, 5.00, 3.00, 2, '2018-03-21 13:16:49', 0, '2018-03-21 13:16:49');
INSERT INTO `embryo` VALUES ('5ffa4f2fcfb644e2a34f6eca620f14db', NULL, NULL, NULL, NULL, '2018-03-21 13:17:22', NULL, '2018-03-21 13:17:22');
INSERT INTO `embryo` VALUES ('dbb365cbd7064b9b9ee2054ab82c454d', NULL, NULL, NULL, NULL, '2018-03-21 13:14:30', NULL, '2018-03-21 13:14:30');
COMMIT;

-- ----------------------------
-- Table structure for embryo_store_rel
-- ----------------------------
DROP TABLE IF EXISTS `embryo_store_rel`;
CREATE TABLE `embryo_store_rel` (
  `id` varchar(255) NOT NULL,
  `store` varchar(255) DEFAULT NULL,
  `embryo` varchar(255) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `del` bit(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
  `id` varchar(255) NOT NULL,
  `store` varchar(255) NOT NULL,
  `slides` varchar(255) NOT NULL COMMENT '骞荤伅鐗囷紝瀛榡son',
  `name` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `rich_description` text,
  `price` decimal(10,0) DEFAULT NULL,
  `cost` decimal(10,0) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `unit` varchar(10) DEFAULT NULL,
  `size` decimal(10,2) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `alive` bit(1) DEFAULT b'1',
  `del` bit(1) DEFAULT b'0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for order_item
-- ----------------------------
DROP TABLE IF EXISTS `order_item`;
CREATE TABLE `order_item` (
  `orderId` varchar(255) NOT NULL DEFAULT '',
  `goods` varchar(255) NOT NULL DEFAULT '',
  `count` int(11) DEFAULT NULL,
  PRIMARY KEY (`orderId`,`goods`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for parts
-- ----------------------------
DROP TABLE IF EXISTS `parts`;
CREATE TABLE `parts` (
  `id` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) DEFAULT NULL,
  `introduction` varchar(255) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for parts_store_rel
-- ----------------------------
DROP TABLE IF EXISTS `parts_store_rel`;
CREATE TABLE `parts_store_rel` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for seller
-- ----------------------------
DROP TABLE IF EXISTS `seller`;
CREATE TABLE `seller` (
  `id` varchar(255) NOT NULL,
  `authing_id` varchar(255) NOT NULL,
  `token` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`authing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for store
-- ----------------------------
DROP TABLE IF EXISTS `store`;
CREATE TABLE `store` (
  `id` varchar(255) NOT NULL,
  `seller` varchar(255) NOT NULL,
  `photo` text NOT NULL COMMENT '搴楅摵澶村儚',
  `name` varchar(100) NOT NULL COMMENT '搴楅摵鍚嶇О',
  `description` text,
  `start` time DEFAULT NULL,
  `end` time DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` int(1) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `district` varchar(255) DEFAULT NULL,
  `detail` varchar(255) DEFAULT NULL,
  `freight` decimal(10,2) DEFAULT NULL,
  `icon` varchar(255) DEFAULT NULL,
  `avgprice` decimal(10,2) DEFAULT NULL,
  `del` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for surface
-- ----------------------------
DROP TABLE IF EXISTS `surface`;
CREATE TABLE `surface` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `parent` varchar(255) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for surface_store_rel
-- ----------------------------
DROP TABLE IF EXISTS `surface_store_rel`;
CREATE TABLE `surface_store_rel` (
  `id` varchar(255) NOT NULL,
  `surface` varchar(255) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for taste
-- ----------------------------
DROP TABLE IF EXISTS `taste`;
CREATE TABLE `taste` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `introduction` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` varchar(255) NOT NULL,
  `authing_id` varchar(255) NOT NULL,
  `token` varchar(255) DEFAULT NULL,
  `wechat_info` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`authing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

SET FOREIGN_KEY_CHECKS = 1;
